#include "showwinner.h"
#include "ui_showwinner.h"
#include<QPainter>
ShowWinner::ShowWinner(QString Winner1Name,QString Winner2Name,QString Winner3Name,QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::ShowWinner)
{
    this->setFixedSize(800,600);
    ui->setupUi(this);
    QPalette pl=ui->textEdit->palette();
    pl.setBrush(QPalette::Base,QBrush(QColor(255,0,0,0)));
    ui->textEdit->setPalette(pl);
    pl=ui->textEdit_2->palette();
    pl.setBrush(QPalette::Base,QBrush(QColor(255,0,0,0)));
    ui->textEdit_2->setPalette(pl);
    pl=ui->textEdit_3->palette();
    pl.setBrush(QPalette::Base,QBrush(QColor(255,0,0,0)));
    ui->textEdit_3->setPalette(pl);
    ui->textEdit->setText(Winner1Name);
    ui->textEdit_2->setText(Winner2Name);
    ui->textEdit_3->setText(Winner3Name);
}

ShowWinner::~ShowWinner()
{
    delete ui;
}
void ShowWinner::paintEvent(QPaintEvent *){
    QPixmap BackGroundPic;
    BackGroundPic.load(":/res/final.png");
    BackGroundPic=BackGroundPic.scaled(BackGroundPic.width()*0.9,BackGroundPic.height()*0.9);
    QPainter painter(this);
    painter.drawPixmap(0,0,this->width(),this->height(),BackGroundPic);
};//重写画画函数进行画画
